import Vue from 'vue'
import Alert from './alert.vue'
function install(Vue) {
 
    Object.defineProperty(Vue.prototype, '$alert', {
        get() {
            let div = document.createElement('div')
            document.body.appendChild(div);
            //alertType 1勾   2叉  3感叹号 
            return (alertType,content, alertSure) => {
                const Constructor = Vue.extend(Alert)
                const Instance = new Constructor({
                    data() {
                        return {
                        	alertType:alertType,
                            content: content,
                            type:1,
                            isshow: true
                        }
                    },
                    methods: {
                        alertSure: alertSure?alertSure:()=>console.log()//确定方法
                    }
                }).$mount(div);
            };
        }
    });
}
 
export default install
